/*
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
*/
package cmd

import (
	"github.com/spf13/cobra"
	"os"
	"satellite/cmd/backup"
	"satellite/cmd/cluster"
	"satellite/cmd/forge"
	"satellite/cmd/meta"
	"satellite/cmd/sql"
)

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
	Use:   "satellite",
	Short: "one tools for mgr operator",
	Long:  `辅助调试mgr operator`,
	// Uncomment the following line if your bare application
	// has an action associated with it:
	Run: func(cmd *cobra.Command, args []string) {
		_ = cmd.Help()
	},
}

// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
	err := rootCmd.Execute()
	if err != nil {
		os.Exit(1)
	}
}

func init() {
	rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
	rootCmd.AddCommand(cluster.Cmd)
	rootCmd.AddCommand(meta.Cmd)
	rootCmd.AddCommand(backup.Cmd)
	rootCmd.AddCommand(sql.Cmd)
	rootCmd.AddCommand(forge.Cmd)
}
